package com.lh.eemsserver.Service.ServiceImple;

import com.lh.eemsserver.Mapper.WorkerMapper;
import com.lh.eemsserver.Service.WorkerService;
import com.lh.eemsserver.po.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
@Service
public class WorkerServiceImple implements WorkerService {

    @Autowired
    private WorkerMapper workerMapper;


    @Override
    public Event getEventInfoByID(@RequestBody Event event) {
        return workerMapper.getEventInfoByID(event);
    }

    @Override
    public List<Material> ListMaterialByLocation(Material material) {
        return workerMapper.ListMaterialByLocation(material);
    }

    @Override
    public List<Report> listAllReport() {
        return workerMapper.listAllReport();
    }

    @Override
    public User userlogin(User user) {
        return workerMapper.userlogin(user);
    }

    @Override
    public int newReportInfo(Report report) {
        return workerMapper.newReportInfo(report);
    }

    @Override
    public List<Report> listReportByReporter(Report report) {
        return workerMapper.listReportByReporter(report);
    }

    @Override
    public List<Report> listReportByState(Report report) {
        return workerMapper.listReportByState(report);
    }

    @Override
    public List<Report> listReportByReportID(Report report) {
        return workerMapper.listReportByReportID(report);
    }

    @Override
    public List<Report> listReportByLastUpdater(Report report) {
        return workerMapper.listReportByLastUpdater(report);
    }

    @Override
    public User getUserById(User user) {
        return workerMapper.getUserById(user);
    }

    @Override
    public Integer updateWorker(User user) {
        return workerMapper.updateWorker(user);
    }

    @Override
    public String[] listAllLocationName() {
        return workerMapper.listAllLocationName();
    }

    @Override
    public List<City> listCityByName(City city) {
        return workerMapper.listCityByName(city);
    }

    @Override
    public String[] listAllCityName() {
        return workerMapper.listAllCityName();
    }

    @Override
    public City getCityByID(City city) {
        return workerMapper.getCityByID(city);
    }

    @Override
    public List<City> listSelectedCity(String cityName) {
        return workerMapper.listSelectedCity(cityName);
    }

    @Override
    public int addProcedureStep(Procedure procedure) {

        workerMapper.addProcedureStep(procedure);
        return workerMapper.insertProcedureStep(procedure);
    }
    @Override
    public int deleteProcedureStep(Procedure procedure) {
        workerMapper.delProcedureStep(procedure);
        return workerMapper.downProcedureStep(procedure);
    }
    @Override
    public int renewProcedureStep( Procedure procedure){
        return workerMapper.renewProcedureStep(procedure);
    }
    @Override
    public int insertEnterprise(@RequestBody Enterprise enterprise){
        workerMapper.newLegalPersonInfo(enterprise);
        return workerMapper.newEnterpriseInfo(enterprise);
    }
    @Override
    public int insertProcedureStep(Procedure procedure) {

        return workerMapper.insertProcedureStep(procedure);
    }

    @Override
    public int newReporterInfo(Report report){
        return workerMapper.newReporterInfo(report);
    }
    @Override
    public int downProcedureStep(Procedure procedure) {
        return workerMapper.downProcedureStep(procedure);
    }

    @Override
    public int getCheckerNum(Material material){
        return workerMapper.getCheckerNum(material);
    }

    @Override
    public int getReporter(Report report){
        return workerMapper.getReporter(report);
    }

    @Override
    public int delProcedureStep(Procedure procedure) {
        return workerMapper.delProcedureStep(procedure);
    }

    @Override
    public Procedure getProcedureByID(Procedure procedure) {
        return workerMapper.getProcedureByID(procedure);
    }

    @Override
    public int newEventType(Event event) {
        return workerMapper.newEventType(event);
    }

    @Override
    public int renewCityInfo(City city) {
        return workerMapper.renewCityInfo(city);
    }

    @Override
    public  List<Procedure> getProcedure(Report report) {
        return workerMapper.getProcedure(report);
    }

    @Override
    public int newProcedureInfo(Procedure procedure) {
        return workerMapper.newProcedureInfo(procedure);
    }

    @Override
    public int delProcedureInfo(Procedure procedure) {
        return workerMapper.newProcedureInfo(procedure);
    }

    @Override
    public List<Material> ListAllMaterialInfo() {
        return workerMapper.ListAllMaterialInfo();
    }

    @Override
    public List<Material> getMaterialInfoByName(Material material) {
        return workerMapper.getMaterialInfoByName(material);
    }

    @Override
    public List<City> listAllCity(City city) {
        return workerMapper.listAllCity(city);
    }


    @Override
    public int newMaterialInfo(Material material) {
        //workerMapper.insertMaterialLocation(material);
        workerMapper.insertChecker(material);
        return workerMapper.insertMaterial(material);
    }

//    @Override
//    public int renewMaterialLocation(Material material) {
//        return workerMapper.renewMaterialLocation(material);
//    }

    @Override
    public int renewChecker(Material material) {
        return workerMapper.renewChecker(material);
    }

    @Override
    public int renewMaterial(Material material) {
        return workerMapper.renewMaterial(material);
    }

    @Override
    public int delMaterialInfo(Material material) {
        return workerMapper.delMaterialInfo(material);
    }

    @Override
    public int delAllMaterialInfo() {
        return workerMapper.delAllMaterialInfo();
    }

    @Override
    public List<Enterprise> listAllEnterpriseInfo(Enterprise enterprise) {
        return workerMapper.listAllEnterpriseInfo(enterprise);
    }

    @Override
    public List<Enterprise> listEnterpriseInfoByName(Enterprise enterprise) {
        return workerMapper.listEnterpriseInfoByName(enterprise);
    }

    @Override
    public List<Enterprise> listEnterpriseInfoByType(Enterprise enterprise) {
        return workerMapper.listEnterpriseInfoByType(enterprise);
    }

    @Override
    public String[] listAllEventType() {
        return workerMapper.listAllEventType();
    }

    @Override
    public int newEnterpriseInfo(Enterprise enterprise) {
        return workerMapper.newEnterpriseInfo(enterprise);
    }

    @Override
    public int renewEnterpriseInfo(Enterprise enterprise) {
        return workerMapper.renewEnterpriseInfo(enterprise);
    }

    @Override
    public int delEnterpriseInfo(Enterprise enterprise) {
        return workerMapper.delEnterpriseInfo(enterprise);
    }

    @Override
    public int delAllEnterpriseInfo() {
        return workerMapper.delAllEnterpriseInfo();
    }

    @Override
    public List<Event> listAllEventInfo() {
        return workerMapper.listAllEventInfo();
    }

    @Override
    public List<Event> listEventInfoByName(Event event) {
        return workerMapper.listEventInfoByName(event);
    }

    @Override
    public List<Event> listEventInfoByRank(Event event) {
        return workerMapper.listEventInfoByRank(event);
    }

    @Override
    public List<Event> listEventInfoByType(Event event) {
        return workerMapper.listEventInfoByType(event);
    }

    @Override
    public int renewEventInfo(Event event) {
        return workerMapper.renewEventInfo(event);
    }

    @Override
    public int newEventInfo(Event event) {
        return workerMapper.newEventInfo(event);
    }

    @Override
    public int delEventInfo(Event event) {
        return workerMapper.delEventInfo(event);
    }

    @Override
    public int delAllEventInfo() {
        return workerMapper.delAllEventInfo();
    }

    @Override
    public String getEventId(Event event) {
        return workerMapper.getEventId(event);
    }

    @Override
    public User getUserName(User user) {
        return workerMapper.getUserName(user);
    }
//    @Override
//    public int insertMaterialLocation(Material material){
//        return workerMapper.insertMaterialLocation(material);
//    }
    @Override
    public int insertChecker(Material material){
        return workerMapper.insertChecker(material);
    }
    @Override
    public int insertMaterial(Material material){
        return workerMapper.insertMaterial(material);
    }
}
